package com.pig4cloud.pig.qc.entity;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;


import java.time.LocalDateTime;


/**
 * 订单表
 *
 * @author QC
 * @since 2025/07/24
 */
@Data
@Schema(description = "订单")
@EqualsAndHashCode(callSuper = true)
@TableName("car_order")
public class OrderEntity extends Model<OrderEntity> {

	@TableId(value = "order_id", type = IdType.ASSIGN_ID)
	@Schema(description = "主键")
	private Long orderId;

	@Schema(description = "订单编号")
//	@TableField(fill = FieldFill.INSERT)
	private String orderCode;

	@Schema(description = "客户ID")
	private Long customerId;

	@Schema(description = "车辆信息ID")
	private Long infoId;

	@Schema(description = "销售人")
	private String salePerson;

	@Schema(description = "销售日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime saleDate;

	@Schema(description = "售卖价格")
	private double salePrice;
//  @Schema(description = "车辆信息")
//	@TableField(exist = false)
//	private CarInfoEntity carInfoEntity;
//	@Schema(description = "客户信息")
//	@TableField(exist = false)
//	private Customer customer;
	@TableField(exist = false)
	private String customerName;

	@TableField(exist = false)
	private String phone;

	@TableField(exist = false)
	private String identityCard;

	@TableField(exist = false)
	private String carCode;
	@TableField(exist = false)
	private String status;
}
